#ifndef __USPI_H__
#define __USPI_H__

#include "gd32e23x.h"
#include "systick.h"
#include "uPin.h"
#include "error.h"

void InitSPI();

error SPI_WriteByte(uint32_t ASPI, uint8_t AByte, uint32 ATimeout);     // ??????????
error SPI_WriteBytes(uint32_t ASPI, uint8_t *pBuffer, uint16_t ACount); // ??????????
error SPI_ReadByte(uint32_t ASPI, uint8_t *AByte, uint32_t ATimeout);   // ??????

error SPI_SendByte(uint32 ASPI, byte ASendByte, pbyte AResByte); // ??????????????
error SPI_ReadByteDummy(uint32 ASPI, pbyte AResByte);            // ??????????(DummyByte)??????

//error SPI_ReadNBytes(uint32_t ASPI, uint8_t *AByte, uint16_t ACount);

#endif